package com.example.springboot_system.Controller;

import com.example.springboot_system.pojo.vo.MedicalExamination.MedicalExaminationReqVO;
import com.example.springboot_system.service.MedicalExaminationService;
import com.example.springboot_system.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping({"/MedicalExamination","/medicalExamination"})
public class MedicalExaminationController {


    @Qualifier("medicalExaminationServiceImpl")
    @Autowired
    private MedicalExaminationService medicalExaminationService;

    @RequestMapping("/searchExamination")
    @ResponseBody
    public ResponseResult searchExamination(String cardId, HttpSession session){
        ResponseResult result = medicalExaminationService.searchExamin(cardId, session);
        return result;
    }

    @RequestMapping("/MoneyToPayExam")
    @ResponseBody
    public ResponseResult MoneyToPayExam(String registerId,HttpSession session) {
        ResponseResult result = medicalExaminationService.MoneyToPayExam(registerId, session);
        return result;
    }

    // 保存体检信息
    @RequestMapping("/saveMedicalExamination")
    @ResponseBody
    public ResponseResult saveMedicalExamination(HttpSession session,
                                                 MedicalExaminationReqVO medicalExaminationReqVO){
        return medicalExaminationService.savePatientExaminationInfo(session,medicalExaminationReqVO);
    }

    @RequestMapping("/getAllOutpatientQueue")
    @ResponseBody
    public ResponseResult getAllOutpatientQueue(HttpSession session){
        return medicalExaminationService.getAllOutpatientQueue(session);
    }
}
